package com.example.permissionservice.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;


@Entity
@Table(name = "roles")
@Data
public class RoleEntity {
    @Id
    @Column(name = "role_id")
    private Integer roleId;

    @NotBlank
    @Size(max = 20)
    @Column(name = "role_code", unique = true, nullable = false)
    private String roleCode;
    //生成getter  setter方法
    public Integer getRoleId(){
        return roleId;
    }
    public void setRoleId(Integer roleId){
        this.roleId = roleId;
    }
    public String getRoleCode(){
        return roleCode;
    }
    public void setRoleCode(String roleCode){
        this.roleCode = roleCode;
    }
}